﻿Imports System.Windows.Data

Public Class NaNConverter
    Implements IValueConverter

    Private Shared _Instance As NaNConverter = New NaNConverter()


    Public Shared ReadOnly Property Instance As NaNConverter
        Get
            Return _Instance
        End Get
    End Property

    Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
        If Double.IsNaN(CDbl(value)) Then Return "Auto"
        Return CDbl(value).ToString("N0")
    End Function

    Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
        'If Str() Then
    End Function
End Class
